package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.Weibo;
import cn.tedu._04mybatis.pojo.vo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
    /*@Insert("INSERT INTO weibo(content,created,user_id) "
            + "values(#{content},#{created},#{userId})")*/
    int insertWeibo(Weibo weibo);

    /*@Delete("DELETE FROM weibo where id=#{wid}")*/
    int deleteWeibo(Long wid);


    /*@Update("UPDATE weibo SET content=#{content},created=#{created},user_id=#{userId} WHERE id=#{id}")*/
    int updateWeibo(Weibo weibo);

    /*@Select("SELECT id,content,created,user_id userId FROM weibo WHERE id = #{wid}")*/
    Weibo selectWeiboBuId(Long wid);

   /* @Select("SELECT content, created FROM weibo WHERE id=#{wid}")*/
    WeiboVO1 selectWeiboVOById(Long wid);

    /*@Select("SELECT id wid,content FROM weibo WHERE user_id = #{userId}")*/
    List<WeiboVO2> selectWeiboVOByUserId(long userId);

    int deleteWeiboByUserIds1(Integer[] ids);

    int deleteWeiboByIds2(List<Integer> ids);

    int dynamicUpdateWeiboById(Weibo weibo);

    int selectCount();

    ResultMapVO1 selectResultMapVOById(Long wid);

    ResultMapVO2 selectResultMapVOById2(Long uid);

    ResultMapVO3 selectResultMapVOById3(Long uid);
}
